import request from '@/utils/request'

// 查询供应商列表
export function listSupplier(query) {
    return request({
        url: '/resource/supply/list',
        method: 'get',
        params: query
    })
}

// 回显右侧基本信息
export function editForm(supplyId) {
    return request({
        url: '/resource/supply/' + supplyId,
        method: 'get',
    })
}

// 回显右侧基本信息
export function saveForm(data) {
    return request({
        url: '/resource/supply',
        method: 'post',
        data: data
    })
}

// 删除左侧list
export function delSupplierList(supplyId) {
    return request({
        url: '/resource/supply/delete/' + supplyId,
        method: 'delete',
    })
}

// 保存名录
export function saveDirectory(data) {
    return request({
        url: '/resource/supply/product',
        method: 'post',
        data: data
    })
}

// 查询实录
export function listProduct(query) {
    return request({
        url: '/resource/supply/product/list',
        method: 'get',
        params: query
    })
}

// 回显实录
export function formProduct(productId) {
    return request({
        url: '/resource/supply/product/' + productId,
        method: 'get',
    })
}

// 删除实录
export function delProduct(productIds) {
    return request({
        url: '/resource/supply/product/delete/' + productIds,
        method: 'delete',
    })
}


//   业绩列表
export function listPerformance(query) {
    return request({
        url: '/resource/supply/performance/list',
        method: 'get',
        params: query
    })
}

// 回显业绩
export function formPerformance(performanceId) {
    return request({
        url: '/resource/supply/performance/' + performanceId,
        method: 'get',
    })
}

// 删除业绩
export function delPerformance(performanceIds) {
    return request({
        url: '/resource/supply/performance/delete/' + performanceIds,
        method: 'delete',
    })
}

// 业绩保存
export function savePerformance(data) {
    return request({
        url: '/resource/supply/performance',
        method: 'post',
        data: data
    })
}

//   资质列表
export function listQualify(query) {
    return request({
        url: '/resource/supply/qualify/list',
        method: 'get',
        params: query
    })
}

// 回显资质
export function formQualify(performanceId) {
    return request({
        url: '/resource/supply/qualify/' + performanceId,
        method: 'get',
    })
}

// 删除资质
export function delQualify(qualifyId) {
    return request({
        url: '/resource/supply/qualify/delete/' + qualifyId,
        method: 'delete',
    })
}

// 资质保存
export function saveQualify(data) {
    return request({
        url: '/resource/supply/qualify',
        method: 'post',
        data: data
    })
}

